package com.pmh.hrs.sys.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import com.pmh.hrs.sys.dao.SysRoleDAO;
import com.pmh.hrs.sys.service.SysRoleService;
import com.pmh.hrs.sys.vo.SysRoleVO;

@Service("sysRoleService")
public class SysRoleServiceImpl implements SysRoleService{

	@Resource(name="sysRoleDAO")
	private SysRoleDAO sysRoleDAO;
	
	
	private SysRoleVO convertSysRoleVO(Map<String,Object> paramMap) throws Exception{
		SysRoleVO sysRoleVO = new SysRoleVO();
		BeanUtils.copyProperties(paramMap, sysRoleVO);
		return sysRoleVO;
	}
	
	@Override
	public int insert(Map<String,Object> paramMap) throws Exception {
		SysRoleVO sysRoleVO =  this.convertSysRoleVO(paramMap);
		return sysRoleDAO.insert(sysRoleVO);
	}

	@Override
	public int update(Map<String,Object> paramMap) throws Exception {
		SysRoleVO sysRoleVO =  this.convertSysRoleVO(paramMap);
		return sysRoleDAO.update(sysRoleVO);
	}

	@Override
	public int delete(Map<String,Object> paramMap) throws Exception {
		return sysRoleDAO.delete(paramMap);
	}

	@Override
	public List<Map<String, Object>> selectList(Map<String,Object> paramMap) throws Exception {
		return sysRoleDAO.selectList(paramMap);
	}

}
